<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/manage/common/taglibs.jsp"%>

<script type="text/javascript">

/**
 * 根据业务需求，输出对应的action
 */
function manage_menu_actionFormatter(value,row,index,dg){
	var actions = formatString($('#manage_menu_action_normal').html(),row.id);
	if(row.showState == 0){
		actions += formatString($('#manage_menu_action_move').html(),row.id);
	}
	return actions;
}


/**
 * 页面加载完成后执行
 */
$(function() {
	//注册按键回车直接提交查询
	$.acooly.framework.registerKeydown('manage_menu_searchform','manage_menu_datagrid');
});


</script>



<div class="easyui-layout" data-options="fit : true,border : false">
  <!-- 查询条件 -->
  <div data-options="region:'north',border:false" style="padding:5px; overflow: hidden;" align="left">
    <form id="manage_menu_searchform" onsubmit="return false">
      <table class="tableForm">
        <tr>
          <td align="left">菜单名称:<input type="text" size="10" name="search_LIKE_name" />
          <a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="$.acooly.framework.search('manage_menu_searchform','manage_menu_datagrid');">查询</a> 
          </td>
        </tr>
      </table>
    </form>
  </div>

  <!-- 列表和工具栏 -->
  <div data-options="region:'center',border:false">
    <table id="manage_menu_datagrid" class="easyui-datagrid" url="${pageContext.request.contextPath}/manage/system/menu/listJson.html" toolbar="#manage_menu_toolbar" fit="true" border="false" fitColumns="true"
      pagination="true" idField="id" pageSize="20" pageList="[ 10, 20, 30, 40, 50 ]" sortName="id" sortOrder="desc" checkOnSelect="true" selectOnCheck="true">
      <thead>
        <tr>
          <th field="formatId" checkbox="true" data-options="formatter:function(value, row, index){ return row.id }">编号</th>
          <th field="id" width="40">编号</th>
          <th field="name" width="100">菜单名称</th>
          <th field="showState" width="50" data-options="formatter:function(value){ return formatRefrence('manage_menu_datagrid','allShowStates',value);}">状态</th>
          <th field="icon" width="50" data-options="formatter:formatIcon">图标</th>
          <th field="descn" width="100">说明</th>
          <th field="action" width="100" data-options="formatter:manage_menu_actionFormatter">动作</th>
        </tr>
      </thead>
    </table>
    
    <!-- 每行的Action动作模板 -->
    <div id="manage_menu_action_normal" style="display: none;">
      <a onclick="$.acooly.framework.edit({url:'/manage/system/menu/edit.html',id:{0},entity:'menu',height:300});" href="#"><img title="编辑" style="width:16px;height:16px;vertical-align:middle;" src="${pageContext.request.contextPath}/manage/plugin/jquery-easyui-1.3.1/themes/icons/edit.png" border="0"/></a>&nbsp
      <a onclick="$.acooly.framework.remove('/manage/system/menu/deleteJson.html',{0},'manage_menu_datagrid');" href="#"><img title="删除" style="width:16px;height:16px;vertical-align:middle;" src="${pageContext.request.contextPath}/manage/plugin/jquery-easyui-1.3.1/themes/icons/delete.png" border="0"/></a>
    </div>
    <div id="manage_menu_action_move" style="display: none;">
      <a onclick="$.acooly.framework.move('/manage/system/menu/moveTop.html',{0},'manage_menu_datagrid');" href="#"><img title="置顶" style="width:16px;height:16px;vertical-align:middle;" src="${pageContext.request.contextPath}/manage/style/icons/action/movetop.png" border="0"/></a>
      <a onclick="$.acooly.framework.move('/manage/system/menu/moveUp.html',{0},'manage_menu_datagrid');" href="#"><img title="上移" style="width:16px;height:16px;vertical-align:middle;" src="${pageContext.request.contextPath}/manage/style/icons/action/moveup.png" border="0"/></a>
    </div>
    
    <!-- 表格的工具栏 -->
    <div id="manage_menu_toolbar">
      <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="$.acooly.framework.create({url:'/manage/system/menu/create.html',entity:'menu',height:300})">添加</a> 
      <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="$.acooly.framework.removes('/manage/system/menu/deleteJson.html','manage_menu_datagrid')">批量删除</a>
      <a href="#" class="easyui-menubutton" data-options="menu:'#manage_menu_exports_menu',iconCls:'icon-export'">批量导出</a>
      <div id="manage_menu_exports_menu" style="width:150px;">
        <div data-options="iconCls:'icon-excel'" onclick="$.acooly.framework.exports('/manage/system/menu/exportXls.html','manage_menu_searchform','菜单数据')">Excel</div>  
        <div data-options="iconCls:'icon-csv'" onclick="framework_export('/manage/system/menu/exportCsv.html','manage_menu_searchform','菜单数据')">CSV</div> 
      </div> 
    </div>
  </div>

</div>
